package likou;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/06/16 07:02
 */
public class _278 {
    public static void main(String[] args) {
        System.out.println(firstBadVersion(2126753390));
    }

    public static boolean isBadVersion(int now){
        return now==1702766719;
    }
    public static int firstBadVersion(int n) {
        return erfen(1 , n);
    }
    public static int erfen(int start , int end){
        if(start==end){
            return start;
        }
        int zhong = start/2+end/2;
        if(isBadVersion(zhong)){
            return erfen(start , zhong);
        }else{
            return erfen(zhong+1,end);
        }
    }
}
